---
title: Conditional Workflow
description: Deterministic branching based on input analysis or business rules
---

**Example Use-Cases**: Content type routing, topic-specific processing, quality-based decisions

Conditional workflows provide predictable branching logic while maintaining deterministic execution paths.

<img 
  className="block dark:hidden" 
  src="/images/workflows-condition-steps-light.png" 
  alt="Workflows condition steps diagram"
/>
<img 
  className="hidden dark:block" 
  src="/images/workflows-condition-steps.png" 
  alt="Workflows condition steps diagram"
/>

## Example

```python conditional_workflow.py
from agno.workflow import Condition, Step, Workflow

def is_tech_topic(step_input) -> bool:
    topic = step_input.input.lower()
    return any(keyword in topic for keyword in ["ai", "tech", "software"])

workflow = Workflow(
    name="Conditional Research",
    steps=[
        Condition(
            name="Tech Topic Check",
            evaluator=is_tech_topic,
            steps=[Step(name="Tech Research", agent=tech_researcher)]
        ),
        Step(name="General Analysis", agent=general_analyst),
    ]
)

workflow.print_response("Comprehensive analysis of AI and machine learning trends", markdown=True)
```

## Developer Resources

- [Condition Steps Workflow](/examples/concepts/workflows/02-workflows-conditional-execution/condition_steps_workflow_stream)
- [Condition with List of Steps](/examples/concepts/workflows/02-workflows-conditional-execution/condition_with_list_of_steps)

## Reference

For complete API documentation, see [Condition Steps Reference](/reference/workflows/conditional-steps).